package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.AppUser;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.system.mapper.AppUserMapper;
import com.ruoyi.system.service.IAppUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysAppUserServiceImpl implements IAppUserService {
    @Autowired
    private AppUserMapper appUserMapper;

    @Override
    public List<AppUser> selectUserList(AppUser appUser) {
        return appUserMapper.list(appUser);
    }

    @Override
    public AppUser selectUserById(Long userId) {
        return appUserMapper.selectByPrimaryKey(userId);
    }


    @Override
    public int insertUser(AppUser user) {
        return appUserMapper.insert(user);
    }

    @Override
    public int updateUser(AppUser user) {
        return appUserMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public int deleteUserByIds(Long[] userIds) {
        return appUserMapper.deleteUserByIds(userIds);
    }

    @Override
    public int resetPwd(AppUser user) {
        return appUserMapper.updateByPrimaryKeySelective(user);
    }

    @Override
    public int updateUserStatus(AppUser user) {
        return appUserMapper.updateByPrimaryKeySelective(user);
    }
}
